class TreeNode:
    leftChild = None
    rightChild = None
    data = None

arr = [4,64,32,6,32,5,6,12,645,65]

i = 0
def AddNode(arr,pos):
    if pos>=len(arr):
        return None

    root = TreeNode();
    root.data = arr[pos]


    if pos<len(arr):
        root.leftChild= AddNode(arr,pos*2+1)
        root.rightChild=AddNode(arr,pos*2+2)
    else:
        return None

    return root


def MidSearch(root):
    if root == None:
        return
    MidSearch(root.leftChild);
    print(root.data)
    MidSearch(root.rightChild)

root = AddNode(arr,0)

MidSearch(root)